﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

public partial class cn_PMasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
            Repeater subRepeater = (Repeater)e.Item.FindControl("subRepeater");
            DataRowView rowv = (DataRowView)e.Item.DataItem;
            //提取大类别的ID
            int categoryId = Convert.ToInt32(rowv["categoryId"]);
            DB db = new DB();
            subRepeater.DataSource = db.getSubCategory(categoryId);
            subRepeater.DataBind();
        }
    }
}
